package com.fjut.controller;

import com.fjut.result.Result;
import com.fjut.service.VodService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;


@Api(tags = "腾讯云点播接口")
@RestController
@RequestMapping("/fjut/vod")
//@CrossOrigin
public class VodController {

    @Autowired
    private VodService vodService;

    @ApiOperation("视频上传")
    @PostMapping("upload")
    public Result upload(MultipartFile file) {
        return Result.success(vodService.upload(file)).message("视频上传成功");
    }

    @ApiOperation("删除视频")
    @DeleteMapping("deleteVideoById/{fileId}")
    public Result deleteVideoById(@PathVariable String fileId){
        return Result.success(vodService.deleteVideoById(fileId)).message("删除视频成功");
    }
}
